:root{
  --navy:#010d35;
  --blue:#0075ff;
  --orange:#fe951c;
  --paper:#f7fbff;
}

*{
  box-sizing:border-box;
}

button,
a{
  font:inherit;
}

.dodge-page{
  padding:0 0 96px;
  background:
    radial-gradient(circle at 12% 12%, rgba(0,117,255,0.14), transparent 28%),
    radial-gradient(circle at 88% 8%, rgba(254,149,28,0.14), transparent 24%),
    linear-gradient(180deg, rgba(238,244,251,0) 0%, #eef7ff 100%);
  color:var(--navy);
}

.dodge-shell{
  width:min(100%, 1120px);
  margin-inline:auto;
  padding-inline:24px;
}

.dodge-topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  margin-bottom:18px;
}

.dodge-back{
  width:52px;
  height:52px;
  flex:0 0 52px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:16px;
  background:#fff;
  color:var(--navy);
  text-decoration:none;
  font-weight:900;
  box-shadow:0 16px 36px rgba(8,24,67,0.12);
}

.dodge-topbar span{
  display:block;
  color:#63708f;
  font-size:0.72rem;
  font-weight:850;
  letter-spacing:0.12em;
  text-transform:uppercase;
}

.dodge-topbar h2{
  margin:2px 0 0;
  font-size:clamp(2rem, 4vw, 3.7rem);
  line-height:1;
}

#dodge-status{
  min-height:38px;
  display:inline-flex;
  align-items:center;
  padding:0 16px;
  border-radius:999px;
  background:linear-gradient(90deg, var(--orange), #ff7b00);
  color:#fff;
  font-size:0.82rem;
  letter-spacing:0.06em;
  text-transform:uppercase;
}

.dodge-game-card{
  position:relative;
  padding:18px;
  border-radius:30px;
  background:rgba(255,255,255,0.96);
  border:1px solid rgba(8,24,67,0.08);
  box-shadow:0 34px 86px rgba(8,24,67,0.14);
}

.dodge-hud{
  display:grid;
  grid-template-columns:repeat(3, minmax(0, 1fr));
  gap:12px;
  margin-bottom:14px;
}

.dodge-hud div{
  min-width:0;
  padding:13px 16px;
  border-radius:18px;
  background:#eef5ff;
  border:1px solid rgba(8,24,67,0.08);
}

.dodge-hud span{
  display:block;
  color:#63708f;
  font-size:0.68rem;
  font-weight:850;
  letter-spacing:0.12em;
  text-transform:uppercase;
  margin-bottom:5px;
}

.dodge-hud strong{
  display:block;
  color:var(--navy);
  font-size:1.4rem;
  line-height:1;
}

.dodge-stage{
  position:relative;
  overflow:hidden;
  border-radius:24px;
  background:#dcecff;
  border:1px solid rgba(8,24,67,0.08);
}

#dodge-canvas{
  width:100%;
  aspect-ratio:16 / 9;
  display:block;
  background:#dcecff;
  cursor:pointer;
}

.dodge-message{
  position:absolute;
  inset:0;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:22px;
  text-align:center;
  pointer-events:none;
  color:#fff;
  text-shadow:0 3px 18px rgba(1,13,53,0.78);
  background:linear-gradient(180deg, rgba(1,13,53,0.08), rgba(1,13,53,0.22));
  transition:opacity 0.22s ease;
}

.dodge-message.is-hidden{
  opacity:0;
}

.dodge-message strong{
  font-size:clamp(2rem, 5vw, 4rem);
  line-height:1;
}

.dodge-message span{
  max-width:520px;
  color:rgba(255,255,255,0.86);
  font-weight:650;
}

.dodge-controls{
  display:grid;
  grid-template-columns:minmax(180px, 0.35fr) minmax(0, 0.65fr);
  gap:14px;
  margin-top:14px;
}

.dodge-pad{
  display:grid;
  grid-template-columns:repeat(3, 54px);
  grid-template-rows:repeat(2, 48px);
  justify-content:center;
  gap:8px;
  padding:10px;
  border-radius:20px;
  background:#eef5ff;
}

.dodge-joystick{
  display:none;
}

.dodge-exit-fullscreen{
  display:none;
}

.dodge-pad button,
.dodge-btn{
  border:none;
  border-radius:999px;
  background:#e4edff;
  color:var(--navy);
  font-weight:900;
}

.dodge-pad button{
  min-width:54px;
}

.dodge-pad button[data-move="up"]{
  grid-column:2;
}

.dodge-pad button[data-move="left"]{
  grid-column:1;
}

.dodge-pad button[data-move="down"]{
  grid-column:2;
}

.dodge-pad button[data-move="right"]{
  grid-column:3;
}

.dodge-actions{
  display:grid;
  grid-template-columns:repeat(4, minmax(0, 1fr));
  gap:10px;
}

.dodge-btn{
  min-height:52px;
  padding:0 14px;
}

.dodge-btn-primary{
  background:linear-gradient(90deg, var(--blue), #13c8dd);
  color:#fff;
  box-shadow:0 18px 36px rgba(0,117,255,0.2);
}

.dodge-btn-fullscreen{
  background:linear-gradient(90deg, var(--navy), var(--blue));
  color:#fff;
  grid-column:1 / -1;
}

.dodge-game-card:fullscreen{
  width:100vw;
  height:100vh;
  max-width:none;
  padding:8px;
  border:none;
  border-radius:0;
  display:flex;
  flex-direction:column;
  background:#eef4fb;
  overflow:hidden;
}

.dodge-game-card:fullscreen .dodge-exit-fullscreen{
  position:fixed;
  z-index:30;
  top:10px;
  right:10px;
  width:36px;
  height:36px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:none;
  border-radius:999px;
  background:rgba(1,13,53,0.88);
  color:#fff;
  font-weight:950;
  box-shadow:0 14px 28px rgba(1,13,53,0.28);
}

.dodge-game-card:fullscreen .dodge-hud{
  position:absolute;
  z-index:12;
  top:8px;
  left:8px;
  width:min(360px, calc(100% - 58px));
  display:flex;
  gap:6px;
  flex:0 0 auto;
  margin:0;
}

.dodge-game-card:fullscreen .dodge-hud div{
  min-width:0;
  flex:1 1 0;
  padding:7px 9px;
  border-radius:12px;
  background:rgba(238,245,255,0.78);
  backdrop-filter:blur(10px);
}

.dodge-game-card:fullscreen .dodge-hud span{
  font-size:0.5rem;
  margin-bottom:2px;
}

.dodge-game-card:fullscreen .dodge-hud strong{
  font-size:1rem;
}

.dodge-game-card:fullscreen .dodge-stage{
  flex:1 1 100%;
  min-height:100%;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:18px;
}

.dodge-game-card:fullscreen #dodge-canvas{
  width:100%;
  height:100%;
  aspect-ratio:auto;
}

.dodge-game-card:fullscreen .dodge-controls{
  position:absolute;
  z-index:14;
  left:12px;
  right:12px;
  bottom:12px;
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:12px;
  margin:0;
  pointer-events:none;
}

.dodge-game-card:fullscreen .dodge-pad{
  display:none;
}

.dodge-game-card:fullscreen .dodge-joystick{
  width:82px;
  height:82px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:50%;
  background:
    radial-gradient(circle at 50% 50%, rgba(255,255,255,0.9) 0 28%, rgba(228,237,255,0.92) 29% 100%);
  border:1px solid rgba(8,24,67,0.12);
  box-shadow:inset 0 0 0 9px rgba(0,117,255,0.08), 0 14px 30px rgba(8,24,67,0.14);
  touch-action:none;
  user-select:none;
  pointer-events:auto;
}

.dodge-game-card:fullscreen .dodge-joystick-knob{
  width:34px;
  height:34px;
  border-radius:50%;
  background:linear-gradient(135deg, var(--blue), #13c8dd);
  box-shadow:0 12px 24px rgba(0,117,255,0.28);
  transform:translate(0, 0);
  transition:transform 0.08s linear;
}

.dodge-game-card:fullscreen .dodge-btn-fullscreen{
  display:none;
}

.dodge-game-card:fullscreen .dodge-actions{
  width:auto;
  display:flex;
  align-items:flex-end;
  justify-content:flex-end;
  gap:8px;
  pointer-events:auto;
}

.dodge-game-card:fullscreen .dodge-btn{
  width:58px;
  height:58px;
  min-height:0;
  padding:0;
  border-radius:50%;
  font-size:0;
  box-shadow:0 10px 22px rgba(1,13,53,0.22);
}

.dodge-game-card:fullscreen #dodge-start::before{
  content:"Start";
}

.dodge-game-card:fullscreen #dodge-jump::before{
  content:"Jump";
}

.dodge-game-card:fullscreen #dodge-duck::before{
  content:"Duck";
}

.dodge-game-card:fullscreen #dodge-reset::before{
  content:"Reset";
}

.dodge-game-card:fullscreen .dodge-btn::before{
  font-size:0.66rem;
  font-weight:950;
}

@media(max-width:760px){
  .dodge-page{
    padding:0 0 18px;
  }

  .dodge-shell{
    padding-inline:10px;
  }

  .dodge-topbar{
    gap:10px;
    margin-bottom:8px;
  }

  .dodge-back{
    width:44px;
    height:44px;
    border-radius:12px;
  }

  #dodge-status{
    min-height:32px;
    padding:0 10px;
    font-size:0.68rem;
  }

  .dodge-game-card{
    padding:7px;
    border-radius:18px;
  }

  .dodge-hud{
    gap:7px;
    margin-bottom:8px;
  }

  .dodge-hud div{
    padding:8px 9px;
    border-radius:14px;
  }

  .dodge-hud span{
    font-size:0.56rem;
  }

  .dodge-hud strong{
    font-size:1.1rem;
  }

  .dodge-stage{
    border-radius:16px;
  }

  #dodge-canvas{
    aspect-ratio:16 / 9;
    height:auto;
    min-height:0;
  }

  .dodge-controls{
    grid-template-columns:132px minmax(0, 1fr);
    gap:8px;
    margin-top:8px;
    align-items:stretch;
  }

  .dodge-pad{
    display:none;
  }

  .dodge-joystick{
    width:132px;
    height:132px;
    display:flex;
    align-items:center;
    justify-content:center;
    border-radius:50%;
    background:
      radial-gradient(circle at 50% 50%, rgba(255,255,255,0.9) 0 28%, rgba(228,237,255,0.92) 29% 100%);
    border:1px solid rgba(8,24,67,0.12);
    box-shadow:inset 0 0 0 9px rgba(0,117,255,0.08), 0 14px 30px rgba(8,24,67,0.14);
    touch-action:none;
    user-select:none;
  }

  .dodge-joystick-knob{
    width:54px;
    height:54px;
    border-radius:50%;
    background:linear-gradient(135deg, var(--blue), #13c8dd);
    box-shadow:0 12px 24px rgba(0,117,255,0.28);
    transform:translate(0, 0);
    transition:transform 0.08s linear;
  }

  .dodge-actions{
    grid-template-columns:repeat(2, minmax(0, 1fr));
    gap:8px;
  }

  .dodge-btn{
    min-height:44px;
    padding:0 8px;
    font-size:0.88rem;
  }

  .dodge-game-card:fullscreen{
    padding:6px;
  }

  .dodge-game-card:fullscreen #dodge-canvas{
    width:100%;
    height:100%;
    min-height:0;
  }

  .dodge-game-card:fullscreen .dodge-joystick{
    width:76px;
    height:76px;
  }

  .dodge-game-card:fullscreen .dodge-joystick-knob{
    width:32px;
    height:32px;
  }

  .dodge-game-card:fullscreen .dodge-btn{
    width:52px;
    height:52px;
  }
}
