*{
  box-sizing:border-box;
  margin:0;
  padding:0;
  font-family:"Space Grotesk",sans-serif;
}

html,
body{
  width:100%;
  min-height:100%;
  overflow-x:hidden;
  background:radial-gradient(circle at top,#281255 0%,#100727 50%,#030108 100%);
  color:white;
}

body{
  min-height:100vh;
}

button,
a,
input{
  font-family:inherit;
}

.game-shell{
  min-height:100vh;
  display:flex;
  flex-direction:column;
}

.top-bar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:16px;
  padding:16px 22px;
  background:rgba(0,0,0,.36);
  border-bottom:1px solid rgba(255,255,255,.08);
  backdrop-filter:blur(14px);
  position:sticky;
  top:0;
  z-index:100;
}

.top-left{
  display:flex;
  align-items:center;
  gap:26px;
  flex:1;
}

.title-wrap h1{
  font-size:clamp(1.35rem,3vw,2.55rem);
  letter-spacing:.12em;
}

.subtitle{
  opacity:.72;
  margin-top:5px;
}

.top-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

.top-btn{
  min-height:48px;
  border:none;
  border-radius:999px;
  padding:12px 20px;
  background:linear-gradient(180deg,rgba(255,255,255,.18),rgba(255,255,255,.08));
  color:white;
  text-decoration:none;
  font-size:1rem;
  font-weight:900;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  box-shadow:0 10px 24px rgba(0,0,0,.28);
}

.hud{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:14px;
  padding:16px 22px 0;
}

.hud-card{
  padding:14px;
  border-radius:18px;
  background:linear-gradient(180deg,rgba(255,255,255,.11),rgba(255,255,255,.045));
  border:1px solid rgba(255,255,255,.08);
}

.hud-label{
  font-size:.82rem;
  text-transform:uppercase;
  letter-spacing:.08em;
  opacity:.7;
  margin-bottom:6px;
}

.hud-value{
  font-size:1.15rem;
  font-weight:1000;
}

.game-area{
  flex:1;
  display:grid;
  grid-template-columns:minmax(320px,760px) minmax(300px,420px);
  justify-content:center;
  align-items:start;
  gap:22px;
  padding:22px;
}

.puzzle-panel,
.wheel-panel{
  display:flex;
  flex-direction:column;
  gap:16px;
}

.puzzle-board{
  min-height:360px;
  display:flex;
  flex-wrap:wrap;
  align-content:center;
  justify-content:center;
  gap:10px;
  padding:24px;
  border-radius:28px;
  background:
    radial-gradient(circle at top,rgba(255,255,255,.13),transparent 36%),
    linear-gradient(135deg,#174dbb,#0d266b 55%,#061135);
  border:1px solid rgba(255,255,255,.12);
  box-shadow:
    0 28px 70px rgba(0,0,0,.5),
    inset 0 0 0 10px rgba(0,0,0,.16);
}

.phrase-space{
  width:22px;
}

.phrase-tile{
  width:clamp(38px,5vw,58px);
  height:clamp(50px,6vw,72px);
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:10px;
  background:linear-gradient(180deg,#f7f7ff,#cfd9ff);
  color:#071137;
  font-size:clamp(1.35rem,3vw,2.2rem);
  font-weight:1000;
  box-shadow:
    inset 0 5px 8px rgba(255,255,255,.6),
    inset 0 -7px 10px rgba(0,0,0,.18),
    0 8px 16px rgba(0,0,0,.25);
}

.phrase-tile.hidden-letter{
  background:linear-gradient(180deg,#144198,#09245f);
  color:transparent;
}

.phrase-tile.punctuation{
  background:transparent;
  box-shadow:none;
  color:white;
}

.status-box{
  padding:16px;
  border-radius:20px;
  background:linear-gradient(180deg,rgba(255,255,255,.11),rgba(255,255,255,.045));
  border:1px solid rgba(255,255,255,.08);
  line-height:1.55;
  font-weight:900;
}

.solve-row{
  display:grid;
  grid-template-columns:1fr auto;
  gap:10px;
}

.solve-input{
  min-height:54px;
  border:none;
  border-radius:18px;
  padding:0 16px;
  font-size:1rem;
  font-weight:900;
  color:white;
  background:rgba(255,255,255,.1);
  border:1px solid rgba(255,255,255,.12);
}

.solve-input::placeholder{
  color:rgba(255,255,255,.58);
}

.action-btn,
.spin-btn{
  min-height:54px;
  border:none;
  border-radius:18px;
  background:linear-gradient(180deg,#ffe66d,#f2a51f);
  color:#180b38;
  font-weight:1000;
  font-size:1rem;
  cursor:pointer;
  box-shadow:0 12px 24px rgba(0,0,0,.28);
}

.wheel-wrap{
  position:relative;
  display:flex;
  justify-content:center;
}

.wheel-pointer{
  position:absolute;
  top:-6px;
  left:50%;
  transform:translateX(-50%);
  z-index:2;
  font-size:2.2rem;
  color:#ffe66d;
  text-shadow:0 3px 10px rgba(0,0,0,.7);
}

.wheel{
  width:min(86vw,320px);
  aspect-ratio:1;
  border-radius:50%;
  position:relative;
  display:flex;
  align-items:center;
  justify-content:center;
  background:
    conic-gradient(
      #ff4d6d 0deg 30deg,
      #ffd166 30deg 60deg,
      #06d6a0 60deg 90deg,
      #118ab2 90deg 120deg,
      #8338ec 120deg 150deg,
      #fb5607 150deg 180deg,
      #ff006e 180deg 210deg,
      #3a86ff 210deg 240deg,
      #2ec4b6 240deg 270deg,
      #ffbe0b 270deg 300deg,
      #7209b7 300deg 330deg,
      #d00000 330deg 360deg
    );
  border:10px solid rgba(255,255,255,.16);
  box-shadow:
    0 25px 60px rgba(0,0,0,.45),
    inset 0 0 0 10px rgba(0,0,0,.2);
  transition:transform 2.2s cubic-bezier(.15,.82,.2,1);
}

.wheel::before{
  content:"";
  position:absolute;
  inset:18%;
  border-radius:50%;
  background:#100727;
  box-shadow:inset 0 0 22px rgba(0,0,0,.7);
}

.wheel-center{
  position:relative;
  z-index:1;
  width:42%;
  aspect-ratio:1;
  border-radius:50%;
  display:flex;
  align-items:center;
  justify-content:center;
  background:linear-gradient(180deg,#ffffff,#cad4ff);
  color:#100727;
  font-weight:1000;
  letter-spacing:.08em;
  box-shadow:0 10px 20px rgba(0,0,0,.35);
}

.keyboard{
  display:grid;
  grid-template-columns:repeat(6,1fr);
  gap:8px;
  padding:14px;
  border-radius:22px;
  background:linear-gradient(180deg,rgba(255,255,255,.11),rgba(255,255,255,.045));
  border:1px solid rgba(255,255,255,.08);
}

.key{
  min-height:46px;
  border:none;
  border-radius:14px;
  cursor:pointer;
  color:white;
  background:linear-gradient(180deg,rgba(255,255,255,.16),rgba(255,255,255,.06));
  border:1px solid rgba(255,255,255,.1);
  font-weight:1000;
  font-size:1rem;
}

.key.correct{
  background:linear-gradient(180deg,rgba(93,255,166,.4),rgba(93,255,166,.13));
}

.key.wrong{
  opacity:.38;
  text-decoration:line-through;
}

.key:disabled{
  cursor:not-allowed;
}

.instructions-overlay{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.78);
  display:flex;
  align-items:center;
  justify-content:center;
  padding:18px;
  z-index:999;
}

.hidden{
  display:none;
}

.instructions-modal{
  width:min(94vw,820px);
  max-height:86vh;
  overflow:auto;
  border-radius:28px;
  background:
    radial-gradient(circle at top,rgba(255,230,109,.18),transparent 40%),
    #100727;
  border:1px solid rgba(255,255,255,.12);
  padding:28px;
  position:relative;
}

.instructions-modal h2{
  margin-bottom:18px;
}

.instructions-content{
  display:flex;
  flex-direction:column;
  gap:18px;
  line-height:1.7;
}

.instructions-content ul{
  padding-left:22px;
}

.close-btn{
  position:absolute;
  top:18px;
  right:18px;
  width:42px;
  height:42px;
  border:none;
  border-radius:50%;
  font-weight:1000;
  cursor:pointer;
}

@media (max-width:980px){
  .game-area{
    grid-template-columns:1fr;
  }

  .puzzle-panel,
  .wheel-panel{
    width:min(94vw,760px);
    margin:0 auto;
  }
}

@media (max-width:720px){
  .top-bar{
    flex-direction:column;
    align-items:flex-start;
  }

  .top-left{
    width:100%;
    flex-wrap:wrap;
    gap:16px;
  }

  .top-actions{
    width:100%;
  }

  .top-btn{
    flex:1;
  }

  .hud{
    grid-template-columns:1fr;
    padding:14px 14px 0;
  }

  .game-area{
    padding:14px;
  }

  .puzzle-board{
    min-height:260px;
    padding:14px;
    gap:6px;
  }

  .phrase-tile{
    width:34px;
    height:46px;
    font-size:1.35rem;
  }

  .solve-row{
    grid-template-columns:1fr;
  }

  .keyboard{
    grid-template-columns:repeat(5,1fr);
  }
}

/* Phrase Spinner compact polish + wheel repair styling */

.top-bar{
  padding:10px 18px !important;
}

.title-wrap h1{
  font-size:clamp(1.25rem,2.4vw,2.05rem) !important;
}

.subtitle{
  font-size:.86rem !important;
}

.hud{
  padding:10px 18px 0 !important;
  gap:10px !important;
}

.hud-card{
  padding:10px 12px !important;
}

.game-area{
  grid-template-columns:minmax(320px,690px) minmax(280px,360px) !important;
  gap:16px !important;
  padding:14px 18px 24px !important;
}

.puzzle-board{
  min-height:285px !important;
  padding:16px !important;
  gap:7px !important;
  border-radius:24px !important;
  background:
    radial-gradient(circle at 50% 0%,rgba(255,255,255,.2),transparent 34%),
    linear-gradient(135deg,#123d9f,#061d61 55%,#030a25) !important;
}

.phrase-tile{
  width:clamp(31px,4vw,49px) !important;
  height:clamp(41px,5vw,60px) !important;
  font-size:clamp(1.1rem,2.5vw,1.8rem) !important;
  border-radius:8px !important;
}

.status-box{
  padding:12px 14px !important;
  border-radius:18px !important;
  font-size:.95rem !important;
}

.solve-row{
  grid-template-columns:1fr 150px !important;
  align-items:stretch !important;
}

.solve-input{
  min-height:62px !important;
  border-radius:20px !important;
  font-size:1.05rem !important;
  background:linear-gradient(180deg,rgba(255,255,255,.16),rgba(255,255,255,.07)) !important;
}

.action-btn{
  min-height:62px !important;
  border-radius:20px !important;
  font-size:1.25rem !important;
  letter-spacing:.08em !important;
  text-transform:uppercase !important;
  background:linear-gradient(180deg,#fff36d,#ff9f1c) !important;
  color:#1b0838 !important;
  box-shadow:
    0 0 0 3px rgba(255,255,255,.18),
    0 16px 28px rgba(0,0,0,.35) !important;
}

.wheel-wrap{
  margin-top:2px !important;
}

.wheel{
  width:min(72vw,270px) !important;
  border-width:8px !important;
}

.wheel-center{
  font-size:1rem !important;
}

.spin-btn{
  min-height:64px !important;
  border-radius:22px !important;
  font-size:1.25rem !important;
  letter-spacing:.08em !important;
  text-transform:uppercase !important;
  background:linear-gradient(180deg,#7df9ff,#2f7cff 48%,#572cff) !important;
  color:white !important;
  box-shadow:
    0 0 0 3px rgba(255,255,255,.16),
    0 16px 28px rgba(0,0,0,.35),
    0 0 28px rgba(125,249,255,.25) !important;
}

.keyboard{
  grid-template-columns:repeat(6,1fr) !important;
  gap:6px !important;
  padding:10px !important;
  border-radius:18px !important;
}

.key{
  min-height:38px !important;
  border-radius:11px !important;
  font-size:.95rem !important;
}

@media (max-width:980px){
  .game-area{
    grid-template-columns:1fr !important;
  }

  .wheel{
    width:min(72vw,260px) !important;
  }
}

@media (max-width:720px){
  .puzzle-board{
    min-height:230px !important;
  }

  .solve-row{
    grid-template-columns:1fr !important;
  }

  .keyboard{
    grid-template-columns:repeat(7,1fr) !important;
  }

  .key{
    min-height:36px !important;
    font-size:.85rem !important;
  }
}

.key{
  position:relative !important;
  min-height:46px !important;
  font-size:1.05rem !important;
}

.key.vowel{
  background:linear-gradient(180deg,rgba(255,230,109,.34),rgba(255,230,109,.12)) !important;
  color:#fff7bf !important;
}

.key.locked{
  opacity:.45 !important;
  filter:grayscale(.5) !important;
}

.key.locked::after{
  content:"SPIN";
  position:absolute;
  right:3px;
  bottom:2px;
  font-size:.48rem;
  opacity:.8;
}

.spin-btn{
  animation:spinPulse 1.6s ease-in-out infinite;
}

@keyframes spinPulse{
  0%,100%{
    transform:scale(1);
  }
  50%{
    transform:scale(1.035);
  }
}

.key.available{
  outline:3px solid rgba(255,255,255,.9) !important;
  box-shadow:0 0 18px rgba(255,255,255,.35) !important;
}

.key.locked{
  opacity:.35 !important;
}

.key.vowel.locked::after{
  content:"$250";
}

.key.locked::after{
  content:"SPIN";
  position:absolute;
  right:3px;
  bottom:2px;
  font-size:.48rem;
  opacity:.85;
}

.key.vowel.available{
  background:linear-gradient(180deg,#ffe66d,#f2a51f) !important;
  color:#180b38 !important;
}

.wheel{
  overflow:hidden !important;
}

.wheel-label{
  width:78px !important;
  margin-left:-39px !important;
  font-size:.56rem !important;
  line-height:1 !important;
  max-height:26px !important;
  overflow:hidden !important;
  z-index:4 !important;
  color:white !important;
}

.wheel-label.special{
  color:#fff36d !important;
  font-size:.52rem !important;
}

.wheel::before{
  inset:28% !important;
}

.wheel-center{
  width:34% !important;
}

.turn-notice{
  position:fixed;
  inset:0;
  z-index:1200;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:20px;
  background:rgba(0,0,0,.48);
  pointer-events:none;
}

.turn-notice.hidden{
  display:none !important;
}

.turn-notice-card{
  width:min(92vw,560px);
  padding:26px;
  border-radius:28px;
  text-align:center;
  background:
    radial-gradient(circle at top,rgba(255,230,109,.24),transparent 42%),
    linear-gradient(180deg,#281255,#100727);
  border:2px solid rgba(255,230,109,.42);
  box-shadow:
    0 30px 80px rgba(0,0,0,.62),
    0 0 36px rgba(255,230,109,.18);
}

.turn-notice-title{
  font-size:1rem;
  font-weight:1000;
  text-transform:uppercase;
  letter-spacing:.1em;
  opacity:.82;
  margin-bottom:10px;
}

.turn-notice-text{
  font-size:1.35rem;
  font-weight:1000;
  line-height:1.35;
}

.hud-card:first-child .hud-value{
  font-size:1rem !important;
  line-height:1.25 !important;
}

.wheel-label{
  position:absolute !important;
  left:50% !important;
  top:50% !important;
  width:76px !important;
  margin-left:-38px !important;
  transform-origin:50% 0 !important;
  text-align:center !important;
  font-size:.58rem !important;
  font-weight:1000 !important;
  line-height:1.05 !important;
  color:#fff !important;
  text-shadow:
    0 2px 4px rgba(0,0,0,.95),
    0 0 6px rgba(0,0,0,.85) !important;
  z-index:5 !important;
  pointer-events:none !important;
}

.wheel-label.special{
  color:#fff36d !important;
  font-size:.52rem !important;
}

.wheel-label.cash{
  color:white !important;
}

.wheel::before{
  inset:32% !important;
}

.wheel-center{
  width:30% !important;
  font-size:.8rem !important;
}
