*,
*::before,
*::after { box-sizing: border-box; }

body.plc-dice-page {
  margin: 0;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  background: radial-gradient(circle at 50% -10%, rgba(55,126,173,.20), transparent 45%), #07131c;
}

body.plc-dice-page .pgs-game-shell,
body.plc-dice-page .entry-content,
body.plc-dice-page .site-main {
  width: 100% !important;
  max-width: 100% !important;
  overflow: visible !important;
  padding: 0 !important;
}

.plc-dice-app {
  --dice-dark:#071720;
  --dice-line:rgba(189,221,235,.16);
  --dice-text:#f5f9fc;
  --dice-muted:#b0c4d0;
  --dice-blue:#2e7bc6;
  --dice-green:#2fd28f;
  --dice-red:#ff6874;
  --dice-yellow:#ffcb66;

  width:min(100%,1120px);
  min-height:100dvh;
  margin:0 auto;
  padding:10px 10px calc(92px + env(safe-area-inset-bottom));
  color:var(--dice-text);
  background:linear-gradient(180deg,#17384b 0%,#102c3d 55%,#0a202e 100%);
  font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}

.plc-dice-app button,
.plc-dice-app input,
.plc-dice-app select { touch-action: manipulation; }

.plc-dice-topbar {
  display:grid;
  grid-template-columns:52px minmax(42px,1fr) minmax(126px,1.55fr) 42px 48px;
  gap:7px;
  align-items:center;
  min-height:60px;
  margin-bottom:8px;
}

.plc-dice-logo,
.plc-dice-wallet,
.plc-dice-profile { text-decoration:none; }

.plc-dice-logo {
  display:grid;
  place-items:center;
  width:52px;
  height:52px;
  border:1px solid var(--dice-line);
  border-radius:16px;
  color:#fff;
  background:#0b2231;
}
.plc-dice-logo span { font-size:23px; font-weight:950; }

.plc-dice-notch-space {
  display:flex;
  align-items:flex-start;
  justify-content:center;
  align-self:stretch;
  padding-top:2px;
}
.plc-dice-notch-space span {
  width:clamp(44px,17vw,82px);
  height:10px;
  border-radius:0 0 12px 12px;
  background:rgba(2,12,18,.82);
}

.plc-dice-wallet {
  min-width:0;
  border:1px solid var(--dice-line);
  border-radius:15px;
  padding:8px 10px;
  color:#fff;
  background:#0b2231;
  text-align:center;
}
.plc-dice-wallet small {
  display:block;
  color:var(--dice-muted);
  font-size:9px;
  font-weight:850;
  letter-spacing:.1em;
  text-transform:uppercase;
}
.plc-dice-wallet strong {
  display:block;
  margin-top:2px;
  overflow:hidden;
  font-size:13px;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.plc-dice-sound,
.plc-dice-profile {
  position:relative;
  display:grid;
  place-items:center;
  width:42px;
  height:42px;
  border:1px solid var(--dice-line);
  border-radius:13px;
  color:var(--dice-muted);
  background:#0b2231;
}
.plc-dice-sound {
  font:inherit;
  font-size:17px;
  font-weight:900;
  cursor:pointer;
}
.plc-dice-sound.is-active { color:var(--dice-green); }

.plc-dice-profile { width:48px; height:48px; }
.plc-dice-profile-head,
.plc-dice-profile-body {
  position:absolute;
  left:50%;
  display:block;
  transform:translateX(-50%);
  background:#e9f1f5;
}
.plc-dice-profile-head {
  top:9px;
  width:12px;
  height:12px;
  border-radius:50%;
}
.plc-dice-profile-body {
  bottom:8px;
  width:24px;
  height:13px;
  border-radius:12px 12px 5px 5px;
}

.plc-dice-toolbar {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:7px;
  margin-bottom:9px;
}

.plc-dice-mode,
.plc-dice-playmode,
.plc-dice-condition {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:4px;
  padding:4px;
  border:1px solid var(--dice-line);
  border-radius:14px;
  background:rgba(7,25,37,.75);
}
.plc-dice-mode button,
.plc-dice-playmode button,
.plc-dice-condition button {
  min-height:42px;
  border:0;
  border-radius:10px;
  padding:4px;
  color:var(--dice-muted);
  background:transparent;
  font:inherit;
  font-size:11px;
  font-weight:900;
  cursor:pointer;
}
.plc-dice-mode button.is-active,
.plc-dice-playmode button.is-active,
.plc-dice-condition button.is-active {
  color:#fff;
  background:#42667d;
}

.plc-dice-layout {
  display:flex;
  flex-direction:column;
  gap:10px;
}
.plc-dice-controls,
.plc-dice-stage {
  border:1px solid var(--dice-line);
  border-radius:18px;
  background:rgba(8,28,41,.62);
}
.plc-dice-stage { order:1; padding:9px; }
.plc-dice-controls { order:2; padding:12px; }

.plc-dice-status {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:9px;
  margin-bottom:9px;
}
.plc-dice-status span {
  display:inline-flex;
  align-items:center;
  min-height:30px;
  border:1px solid var(--dice-line);
  border-radius:999px;
  padding:5px 10px;
  color:var(--dice-muted);
  background:rgba(7,25,37,.62);
  font-size:10px;
  font-weight:850;
}
.plc-dice-status strong {
  max-width:55%;
  font-size:11px;
  text-align:right;
}
.plc-dice-status strong[data-type="error"],
.plc-dice-status strong[data-type="loss"] { color:var(--dice-red); }
.plc-dice-status strong[data-type="win"] { color:var(--dice-green); }

.plc-dice-result-card {
  display:grid;
  place-items:center;
  min-height:210px;
  border:1px solid var(--dice-line);
  border-radius:18px;
  background:radial-gradient(circle at 50% 45%,rgba(56,135,195,.18),transparent 45%),#071720;
  text-align:center;
}
.plc-dice-result-card small {
  color:var(--dice-muted);
  font-size:10px;
  font-weight:900;
  letter-spacing:.12em;
  text-transform:uppercase;
}
.plc-dice-result-card strong {
  display:block;
  margin:4px 0;
  font-size:clamp(56px,18vw,96px);
  line-height:1;
  letter-spacing:-.055em;
  transition:color .18s ease, transform .18s ease;
}
.plc-dice-result-card strong.is-win { color:var(--dice-green); transform:scale(1.04); }
.plc-dice-result-card strong.is-loss { color:var(--dice-red); }
.plc-dice-result-card span { color:var(--dice-muted); font-size:12px; font-weight:800; }

.plc-dice-track-card {
  margin-top:11px;
  padding:12px;
  border:1px solid var(--dice-line);
  border-radius:15px;
  background:rgba(5,22,33,.72);
}
.plc-dice-track-labels {
  display:flex;
  justify-content:space-between;
  margin-bottom:7px;
  color:var(--dice-muted);
  font-size:9px;
}
.plc-dice-track {
  position:relative;
  height:34px;
  overflow:visible;
  border-radius:999px;
  background:#08141d;
}
.plc-dice-win-zone,
.plc-dice-loss-zone {
  position:absolute;
  top:0;
  height:100%;
}
.plc-dice-win-zone { background:linear-gradient(90deg,#19875b,#2fd28f); }
.plc-dice-loss-zone { background:linear-gradient(90deg,#b53f4b,#ff6874); }

.plc-dice-target-marker,
.plc-dice-result-marker {
  position:absolute;
  top:50%;
  width:4px;
  height:48px;
  border-radius:999px;
  transform:translate(-50%,-50%);
}
.plc-dice-target-marker {
  z-index:3;
  background:#fff;
  box-shadow:0 0 0 3px rgba(255,255,255,.14);
}
.plc-dice-result-marker {
  z-index:4;
  width:12px;
  height:12px;
  border:3px solid #fff;
  border-radius:50%;
  background:var(--dice-yellow);
  transition:left .08s linear;
}

.plc-dice-field + .plc-dice-field,
.plc-dice-auto-panel,
.plc-dice-roll,
.plc-dice-stats-grid { margin-top:12px; }

.plc-dice-field > label,
.plc-dice-label-row label {
  display:block;
  margin-bottom:7px;
  color:#dce8ef;
  font-size:11px;
  font-weight:900;
  letter-spacing:.08em;
  text-transform:uppercase;
}

.plc-dice-label-row {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
}
.plc-dice-label-row span,
.plc-dice-label-row strong {
  color:var(--dice-muted);
  font-size:11px;
  font-weight:800;
}

.plc-dice-stepper {
  display:grid;
  grid-template-columns:minmax(0,1fr) 58px 58px;
  overflow:hidden;
  border:1px solid var(--dice-line);
  border-radius:13px;
  background:rgba(5,22,33,.82);
}

.plc-dice-stepper input,
.plc-dice-auto-panel input,
.plc-dice-auto-panel select {
  width:100%;
  min-height:48px;
  border:1px solid var(--dice-line);
  border-radius:12px;
  outline:0;
  color:#fff;
  background:rgba(5,22,33,.82);
  padding:11px 12px;
  font:inherit;
  font-size:16px;
  font-weight:800;
}
.plc-dice-stepper input { border:0; border-radius:0; }
.plc-dice-stepper button {
  min-height:48px;
  border:0;
  border-left:1px solid rgba(255,255,255,.14);
  color:#fff;
  background:#46697e;
  font:inherit;
  font-size:18px;
  font-weight:900;
  cursor:pointer;
}

.plc-dice-range { width:100%; accent-color:var(--dice-blue); }

.plc-dice-stats-grid {
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:6px;
}
.plc-dice-stats-grid > div {
  min-width:0;
  border:1px solid var(--dice-line);
  border-radius:12px;
  padding:9px 6px;
  background:rgba(5,22,33,.74);
}
.plc-dice-stats-grid span {
  display:block;
  color:var(--dice-muted);
  font-size:8px;
  font-weight:900;
  letter-spacing:.07em;
  text-transform:uppercase;
}
.plc-dice-stats-grid strong {
  display:block;
  margin-top:4px;
  overflow:hidden;
  font-size:13px;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.plc-dice-auto-grid {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:8px;
}
.plc-dice-auto-note {
  margin:8px 0 0;
  color:var(--dice-muted);
  font-size:10px;
}

.plc-dice-roll {
  width:100%;
  min-height:56px;
  border:0;
  border-radius:15px;
  color:#fff;
  background:linear-gradient(135deg,#2468a8,#3385cf);
  font:inherit;
  font-size:18px;
  font-weight:950;
  cursor:pointer;
}
.plc-dice-roll.is-running { background:linear-gradient(135deg,#bd3e4a,#e05b67); }
.plc-dice-roll:disabled { opacity:.62; cursor:not-allowed; }

.plc-dice-history-section { margin-top:14px; }
.plc-dice-section-title {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  margin-bottom:8px;
}
.plc-dice-section-title span { font-size:12px; font-weight:900; }
.plc-dice-section-title small { color:var(--dice-muted); font-size:9px; }

.plc-dice-history { display:grid; gap:6px; }
.plc-dice-history > p { margin:0; color:var(--dice-muted); font-size:11px; }
.plc-dice-history > div {
  display:grid;
  grid-template-columns:minmax(0,1.1fr) .55fr .75fr;
  gap:6px;
  align-items:center;
  border:1px solid var(--dice-line);
  border-radius:10px;
  padding:8px 9px;
  background:rgba(5,22,33,.68);
  font-size:10px;
}
.plc-dice-history b { grid-column:1 / -1; text-align:left; }
.plc-dice-history .is-win { color:var(--dice-green); }
.plc-dice-history .is-loss { color:var(--dice-red); }

.plc-dice-bottom-nav {
  position:fixed;
  z-index:50;
  left:50%;
  bottom:max(7px,env(safe-area-inset-bottom));
  display:grid;
  grid-template-columns:repeat(4,1fr);
  width:min(calc(100% - 16px),700px);
  min-height:64px;
  transform:translateX(-50%);
  overflow:hidden;
  border:1px solid var(--dice-line);
  border-radius:17px;
  background:rgba(10,34,48,.97);
  box-shadow:0 14px 38px rgba(0,0,0,.36);
  backdrop-filter:blur(14px);
}
.plc-dice-bottom-nav a,
.plc-dice-bottom-nav button {
  display:flex;
  min-width:0;
  align-items:center;
  justify-content:center;
  flex-direction:column;
  gap:3px;
  border:0;
  color:var(--dice-muted);
  background:transparent;
  text-decoration:none;
  font:inherit;
  cursor:pointer;
}
.plc-dice-bottom-nav span { font-size:18px; line-height:1; }
.plc-dice-bottom-nav strong { font-size:10px; }

@media (min-width:801px) {
  .plc-dice-app { padding:18px; }
  .plc-dice-layout {
    display:grid;
    grid-template-columns:minmax(280px,340px) minmax(0,1fr);
    gap:12px;
  }
  .plc-dice-controls { order:1; align-self:start; }
  .plc-dice-stage { order:2; }
  .plc-dice-result-card { min-height:340px; }
  .plc-dice-bottom-nav {
    position:sticky;
    left:auto;
    bottom:auto;
    width:100%;
    margin-top:12px;
    transform:none;
  }
}

@media (max-width:390px) {
  .plc-dice-app { padding-inline:6px; }
  .plc-dice-topbar {
    grid-template-columns:48px minmax(30px,.7fr) minmax(106px,1.55fr) 38px 44px;
    gap:5px;
  }
  .plc-dice-logo { width:48px; height:48px; }
  .plc-dice-profile { width:44px; height:44px; }
  .plc-dice-sound { width:38px; height:38px; }
  .plc-dice-stepper { grid-template-columns:minmax(0,1fr) 52px 52px; }
}

@media (hover:none) {
  .plc-dice-app button:hover { transform:none; }
}

/* PLC GAME responsive baseline: preserves the original layout without manual zoom/fit controls. */
*,*::before,*::after{box-sizing:border-box}
html,body{max-width:100%;overflow-x:hidden}
img,svg,canvas,video{max-width:100%}
@media(max-width:782px){body{min-width:0!important}.plc-game-shell,.plc-game-app{max-width:100%!important}}

