:root {
  --torii-red: #a8433a;
  --torii-red-dark: #8a352d;
  --ink: #3d3547;
  --card-bg: rgba(255, 255, 255, 0.72);
  --card-border: rgba(255, 255, 255, 0.9);
  --error-bg: rgba(168, 67, 58, 0.1);
  --error-text: #8a352d;
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background-image: url("assets/background.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.card {
  width: 100%;
  max-width: 460px;
  padding: 40px 36px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(61, 53, 71, 0.18);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

h1 {
  margin: 0 0 8px;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.subtitle {
  margin: 0 0 28px;
  font-size: 15px;
  line-height: 1.5;
  color: rgba(61, 53, 71, 0.75);
}

#mapcode-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

input[type="url"] {
  padding: 14px 16px;
  font-size: 15px;
  border: 1px solid rgba(61, 53, 71, 0.18);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.85);
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s ease;
}

input[type="url"]:focus {
  border-color: var(--torii-red);
}

button {
  font-family: inherit;
  cursor: pointer;
}

#submit-btn {
  padding: 14px 16px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  background: var(--torii-red);
  border: none;
  border-radius: 12px;
  transition: background 0.15s ease, transform 0.1s ease;
}

#submit-btn:hover:not(:disabled) {
  background: var(--torii-red-dark);
}

#submit-btn:active:not(:disabled) {
  transform: scale(0.98);
}

#submit-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.result {
  margin-top: 24px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(61, 53, 71, 0.1);
  border-radius: 14px;
}

.place-name {
  font-size: 16px;
  font-weight: 700;
}

.place-address {
  margin-top: 2px;
  font-size: 13px;
  font-style: italic;
  color: rgba(61, 53, 71, 0.75);
}

.maps-link {
  display: inline-block;
  margin-top: 8px;
  margin-bottom: 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--torii-red);
  text-decoration: none;
}

.maps-link:hover {
  text-decoration: underline;
}

.result-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(61, 53, 71, 0.6);
  margin-bottom: 6px;
}

.result-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.mapcode-value {
  font-family: "SF Mono", "Menlo", "Consolas", monospace;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.copy-btn {
  flex-shrink: 0;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--torii-red);
  background: rgba(168, 67, 58, 0.1);
  border: none;
  border-radius: 8px;
  transition: background 0.15s ease;
}

.copy-btn:hover {
  background: rgba(168, 67, 58, 0.18);
}

.result-meta {
  margin-top: 10px;
  font-size: 13px;
  color: rgba(61, 53, 71, 0.6);
}

.error {
  margin-top: 24px;
  padding: 16px 18px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--error-text);
  background: var(--error-bg);
  border: 1px solid rgba(168, 67, 58, 0.2);
  border-radius: 12px;
}

@media (max-width: 480px) {
  .card {
    padding: 32px 24px;
  }
}
