/*
Theme Name: Wheel Spin
Theme URI: http://localhost:8090/
Author: Wheel Spin
Description: One-page random name and number picker with reserved AdSense areas.
Version: 1.0.0
*/

:root {
  --bg: #f7f9ff;
  --surface: #ffffff;
  --text: #171923;
  --muted: #69707d;
  --line: #e5e7eb;
  --accent: #5b4ee8;
  --accent-dark: #4538c7;
  --shadow: 0 18px 50px rgba(64, 70, 115, .12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, input, textarea { font: inherit; }

.site-shell { min-height: 100vh; padding: 10px 18px 24px; background: radial-gradient(circle at 50% 20%, #fff 0, #f8fbff 45%, #f2f5ff 100%); }
.page-grid {
  width: min(1580px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 270px minmax(760px, 990px) 270px;
  grid-template-areas:
    "top top top"
    "left main right"
    "bottom bottom bottom"
    "seo seo seo";
  gap: 20px;
  align-items: start;
}
.ad-slot {
  min-height: 0;
  min-width: 0;
  height: auto;
  border: 1px dashed #cbd5e1;
  border-radius: 14px;
  background: rgba(255,255,255,.70);
  color: #9ba5b4;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.adsense-content { width: 100%; height: auto; display: flex; align-items: center; justify-content: center; overflow: visible; }
.adsense-content ins.adsbygoogle { max-width: 100%; }
.ad-slot .adsbygoogle { margin: 0 auto; }
.ad-top { grid-area: top; width: min(100%, 100%); justify-self: center; }
.ad-left { grid-area: left; width: 100%; }
.ad-right { grid-area: right; width: 100%; }
.ad-bottom { grid-area: bottom; width: min(100%, 100%); }

.main-card {
  grid-area: main;
  background: var(--surface);
  border: 1px solid #e4e8f2;
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 26px 28px;
  min-height: 610px;
  display: grid;
  grid-template-columns: minmax(480px, 1.35fr) minmax(320px, .9fr);
  align-items: center;
  gap: 22px;
}
.wheel-panel { min-width: 0; }
.brand { text-align: left; margin: 0 0 20px; }
.brand h1 { margin: 0; font-size: clamp(32px, 3.5vw, 42px); letter-spacing: -.045em; }
.brand p { margin: 7px 0 0; color: var(--muted); font-size: 15px; }

.wheel-wrap { position: relative; width: min(570px, 100%); margin: 0 auto; aspect-ratio: 1; }
#wheel { display: block; width: 100%; height: 100%; }
.wheel-pointer {
  position: absolute;
  top: -7px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 18px solid transparent;
  border-right: 18px solid transparent;
  border-top: 34px solid #ff5264;
  z-index: 3;
  filter: drop-shadow(0 3px 2px rgba(0,0,0,.18));
}
.spin-button {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  width: clamp(92px, 20%, 116px);
  aspect-ratio: 1;
  border: 7px solid rgba(255,255,255,.95);
  border-radius: 50%;
  background: linear-gradient(145deg, #6958f4, #4d3be1);
  color: white;
  font-size: clamp(17px, 3vw, 22px);
  font-weight: 800;
  letter-spacing: .03em;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(69,70,189,.34);
  z-index: 4;
}
.spin-button:hover { background: var(--accent-dark); }
.spin-button:disabled { cursor: not-allowed; opacity: .65; }
.spin-icon { display:block; font-size: 18px; line-height: 15px; margin-bottom: 2px; }

.control-panel { min-width: 0; padding: 4px 0; }
.control-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 5px; background: #f0f2f9; border-radius: 12px; margin-bottom: 16px; }
.tab { border: 0; border-radius: 9px; background: transparent; color: #6c7383; padding: 10px 8px; font-weight: 800; cursor: pointer; }
.tab.is-active { color: white; background: linear-gradient(135deg, #6655f0, #5746df); box-shadow: 0 5px 12px rgba(91,78,232,.2); }
.tab span { margin-right: 5px; }

.controls { display: grid; gap: 12px; }
.input-label { font-weight: 700; }
.entry-box {
  width: 100%;
  min-height: 138px;
  resize: vertical;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  outline: none;
}
.entry-box:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(91,92,226,.10); }
.hint { margin: 0; color: var(--muted); font-size: 13px; }
.entry-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.primary-button { border: 0; border-radius: 11px; padding: 12px 16px; color: white; background: linear-gradient(135deg,#6655f0,#5746df); cursor: pointer; font-weight: 800; box-shadow: 0 7px 15px rgba(91,78,232,.22); }
.primary-button:hover { filter: brightness(.97); }
.secondary-button {
  border: 1px solid var(--line);
  background: white;
  color: var(--text);
  border-radius: 11px;
  padding: 10px 15px;
  cursor: pointer;
  font-weight: 700;
}
.secondary-button:hover { background: #f8f8fb; }
.items { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 4px; }
.item { border-radius: 999px; background: #f0f1ff; color: #3f40a8; padding: 6px 10px; font-size: 13px; }

.winner {
  display: block;
  margin: 18px auto 0;
  padding: 15px;
  min-height: 105px;
  border-radius: 14px;
  text-align: center;
  background: linear-gradient(135deg,#fbfdff,#f7f8ff);
  border: 1px solid #edf0f7;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9);
}
.winner.is-visible { animation: winner-in .35s ease-out; }
.winner-icon { font-size: 22px; line-height: 24px; }
.winner small { display: block; color: #242938; font-size: 15px; font-weight: 800; margin-bottom: 3px; }
.winner strong { font-size: 14px; color: var(--muted); letter-spacing: 0; }
@keyframes winner-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.seo-content {
  grid-area: seo;
  width: min(1100px, 100%);
  margin: 0 auto;
  padding: 30px 8px 10px;
  color: var(--text);
}
.seo-content h2 { margin: 0 0 10px; font-size: 28px; letter-spacing: -.025em; }
.seo-content h3 { margin: 0 0 7px; font-size: 18px; }
.seo-content p { color: var(--muted); line-height: 1.7; margin: 0 0 18px; }
.seo-columns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin: 22px 0 30px; }
.seo-columns > div { background: rgba(255,255,255,.78); border: 1px solid #e8ebf3; border-radius: 14px; padding: 18px; }
.faq-list { display: grid; gap: 10px; }
.faq-list details { background: rgba(255,255,255,.78); border: 1px solid #e8ebf3; border-radius: 12px; padding: 15px 18px; }
.faq-list summary { cursor: pointer; font-weight: 750; }
.faq-list p { margin: 10px 0 0; }

@media (max-width: 980px) {
  .page-grid {
    grid-template-columns: 1fr 1fr;
    grid-template-areas: "top top" "main main" "left right" "bottom bottom" "seo seo";
  }
  .main-card { grid-template-columns: 1fr; }
  .control-panel { padding: 0; }
  .brand { text-align: center; }
  .ad-left, .ad-right { width: 100%; }
  .seo-columns { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .site-shell { padding: 10px; }
  .page-grid { display: flex; flex-direction: column; }
  .main-card { order: 1; width: 100%; padding: 18px; border-radius: 20px; }
  .ad-top { order: 0; width: 100%; }
  .ad-left, .ad-right, .ad-bottom { width: 100%; }
  .ad-left { order: 2; }
  .ad-right { order: 3; }
  .ad-bottom { order: 4; }
}
