* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  height: 100%;
  overflow: hidden;
  font-family: system-ui, -apple-system, sans-serif;
  background: #1a1a1a;
  color: #fff;
  touch-action: none;
}

.hidden {
  display: none !important;
}

.page-info {
  overflow: auto;
  touch-action: auto;
  line-height: 1.6;
  padding: 2rem 1.5rem 5rem;
  min-height: 100vh;
  height: auto;
}

#intro {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0d1b2a;
  overflow: hidden;
}

.intro-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  opacity: 0.35;
  pointer-events: none;
}

.intro-card {
  position: relative;
  z-index: 1;
  background: rgba(255, 255, 255, 0.95);
  color: #222;
  border-radius: 1.5rem;
  padding: 2rem 1.5rem;
  max-width: 320px;
  width: 90vw;
  text-align: center;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}
.intro-card h1 {
  font-size: 1.2rem;
  line-height: 1.4;
  margin-bottom: 1.2rem;
  color: #111;
}
.intro-card label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: #555;
}
.intro-card input[type=number] {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid #ddd;
  border-radius: 0.75rem;
  font-size: 1.4rem;
  text-align: center;
  letter-spacing: 0.2em;
  background: #f8f8f8;
  color: #222;
  margin-bottom: 0.75rem;
  -moz-appearance: textfield;
}
.intro-card input[type=number]::-webkit-outer-spin-button, .intro-card input[type=number]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.intro-card input[type=number]:focus {
  outline: none;
  border-color: #e040fb;
}
.intro-card input[type=number].shake {
  animation: shake 0.4s ease;
  border-color: #e53935;
}

@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-8px);
  }
  40% {
    transform: translateX(8px);
  }
  60% {
    transform: translateX(-5px);
  }
  80% {
    transform: translateX(5px);
  }
}
#enter-btn {
  width: 100%;
  padding: 0.75rem;
  border: none;
  border-radius: 0.75rem;
  background: #e040fb;
  color: #fff;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 1.2rem;
}
#enter-btn:active {
  transform: scale(0.97);
}

.intro-credit {
  font-size: 0.75rem;
  color: #888;
  margin-bottom: 0.75rem;
  line-height: 1.4;
}
.intro-credit a {
  color: #e040fb;
  text-decoration: none;
  font-weight: 600;
}

.intro-warning {
  font-size: 0.8rem;
  font-weight: 700;
  color: #e53935;
}

#help-popup {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.help-card {
  background: #2a2a2a;
  border-radius: 1.2rem;
  padding: 1.5rem 1.5rem 1.2rem;
  max-width: 300px;
  width: 85vw;
  text-align: center;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}
.help-card h2 {
  font-size: 1.2rem;
  margin-bottom: 1rem;
  color: #fff;
}
.help-card p {
  font-size: 0.9rem;
  color: #ccc;
  margin-bottom: 0.7rem;
  line-height: 1.4;
}

.help-links {
  display: flex;
  gap: 1.2rem;
  justify-content: center;
  margin: 1rem 0;
}
.help-links a {
  color: #e040fb;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
}

#help-ok-btn {
  width: 100%;
  padding: 0.65rem;
  border: none;
  border-radius: 0.6rem;
  background: #e040fb;
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 0.5rem;
}
#help-ok-btn:active {
  transform: scale(0.97);
}

#wall-container {
  width: 100%;
  height: 100%;
  overflow: hidden;
  position: relative;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

#wall-surface {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
  will-change: transform;
}

#wall-canvas {
  display: block;
  width: 100%;
  height: 100%;
  background: url("../images/porto.png") center/cover no-repeat;
}

#toolbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.4rem 0.5rem 0.5rem;
  background: #f5e6fa;
  border-top: 1px solid #e0c4eb;
}
#toolbar button {
  border: none;
  border-radius: 0.5rem;
  background: transparent;
  color: #555;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 0.3rem 0.5rem;
  transition: background 0.15s, color 0.15s;
}
#toolbar button:active {
  transform: scale(0.92);
}
#toolbar button.active {
  background: #e040fb;
  color: #fff;
}
#toolbar button:disabled {
  opacity: 0.3;
  cursor: default;
}
#toolbar button:disabled:active {
  transform: none;
}

.tool-icon {
  font-size: 1.2rem;
  line-height: 1;
  width: 1.5rem;
  height: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tool-label {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #333;
  opacity: 1;
}

.tool-color-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 0.15rem;
  padding: 0.3rem 0.5rem;
}

#color-picker {
  width: 1.5rem;
  height: 1.5rem;
  border: 2px solid #555;
  border-radius: 50%;
  cursor: pointer;
  padding: 0;
  background: none;
  -webkit-appearance: none;
  appearance: none;
}
#color-picker::-webkit-color-swatch-wrapper {
  padding: 1px;
}
#color-picker::-webkit-color-swatch {
  border: none;
  border-radius: 50%;
}

.bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1rem;
  background: #f5e6fa;
  border-top: 1px solid #e0c4eb;
}
.bottom-bar a {
  color: #222;
  text-decoration: none;
  font-weight: 700;
  font-size: 1rem;
}
.bottom-bar a:hover {
  text-decoration: underline;
}

.container {
  max-width: 600px;
  margin: 0 auto;
}

.title-block {
  text-align: center;
  margin-bottom: 2.5rem;
  padding-top: 1rem;
}
.title-block h1 {
  font-size: 1.6rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1.3;
}
.title-block h1 .small {
  font-size: 0.9rem;
  font-weight: 400;
  text-transform: lowercase;
  letter-spacing: 0;
  display: block;
  margin: 0.2rem 0;
}
.title-block .subtitle {
  margin-top: 1.2rem;
  font-size: 0.95rem;
  color: #aaa;
}

.faq {
  margin-bottom: 2.5rem;
}

.faq-item {
  margin-bottom: 1.5rem;
}
.faq-item .question {
  font-weight: 700;
  font-size: 1rem;
  text-transform: uppercase;
  color: #e040fb;
  margin-bottom: 0.3rem;
}
.faq-item .answer {
  font-size: 0.95rem;
  color: #ddd;
}
.faq-item .answer a {
  color: #e040fb;
  text-decoration: none;
}
.faq-item .answer a:hover {
  text-decoration: underline;
}

.projects-section {
  margin-bottom: 2.5rem;
}
.projects-section a {
  color: #e040fb;
  text-decoration: none;
}
.projects-section a:hover {
  text-decoration: underline;
}
.projects-section h2 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: #ccc;
}

.embed-wrap {
  margin-bottom: 1.5rem;
}
.embed-wrap iframe {
  max-width: 100%;
  border-radius: 0.5rem;
}

.closing {
  text-align: center;
  font-size: 1.1rem;
  font-weight: 600;
  margin: 2rem 0;
  color: #f0f0f0;
}
