.wrt-game-layout { display: flex; gap: 20px; align-items: flex-start; justify-content: center; max-width: 830px; margin: 0 auto 50px; flex-wrap: wrap; }
.wrt-game-layout.no-sidebar { max-width: 580px; }
.wrt-game { background: #fff; border-radius: 16px; padding: 26px; box-shadow: 0 4px 20px rgba(0,0,0,0.10); max-width: 580px; flex: 1 1 420px; margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif; color: #222; }
.wrt-game * { box-sizing: border-box; }
.wrt-game button { touch-action: manipulation; -webkit-tap-highlight-color: transparent; min-height: 44px; }
.wrt-game h3 { margin: 0 0 6px; font-size: 22px; text-align: center; color: #1e293b; }
.wrt-game-sub { text-align: center; color: #6b7280; font-size: 14px; margin-bottom: 18px; }

.wrt-game-step { display: none; }
.wrt-game-step.is-active { display: block; }

.wrt-game-name-input {
    display: block; width: 100%; max-width: 260px; margin: 0 auto 14px; padding: 10px 14px;
    border: 2px solid #d1d5db; border-radius: 100px; font-size: 16px; text-align: center; font-weight: 600;
}
.wrt-game-name-input:focus { outline: none; border-color: #059669; }
.wrt-game-greeting { text-align: center; font-weight: 700; color: #059669; margin-bottom: 8px; font-size: 15px; }

.wrt-game-sidebar {
    background: #ecfdf5; border: 2px solid #a7f3d0; border-radius: 16px; padding: 18px 18px 10px;
    width: 240px; flex: 0 0 240px; box-sizing: border-box; max-height: 460px; overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.wrt-game-sidebar .wrt-game-choice-label { margin-top: 0; text-align: center; }
.wrt-game-lb-list { list-style: none; margin: 8px 0 0; padding: 0; }
.wrt-game-lb-list li { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: 13.5px; border-bottom: 1px solid #cdf0e0; }
.wrt-game-lb-list li:last-child { border-bottom: none; }
.wrt-game-lb-rank { width: 24px; text-align: center; font-weight: 700; flex-shrink: 0; }
.wrt-game-lb-name { flex: 1; font-weight: 600; color: #333; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wrt-game-lb-points { font-weight: 700; color: #047857; white-space: nowrap; }
.wrt-game-lb-empty { font-size: 13px; color: #065f46; text-align: center; margin: 10px 0 6px; }

.wrt-game-choice-label { font-weight: 700; font-size: 14px; margin: 14px 0 8px; color: #374151; text-align: center; }

.wrt-game-mode-row { display: flex; gap: 10px; justify-content: center; align-items: center; flex-wrap: wrap; }
.wrt-game-mode-btn {
    border: 2px solid #d1d5db; background: #f9fafb; border-radius: 14px; padding: 11px 16px; cursor: pointer;
    font-size: 15px; font-weight: 800; transition: all 0.15s;
}
.wrt-game-mode-btn:hover { border-color: #059669; background: #ecfdf5; }
.wrt-game-mode-btn.is-selected { border-color: #059669; background: #059669; color: #fff; }

.wrt-game-toggle { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 12px; font-size: 14px; font-weight: 700; color: #374151; }
.wrt-game-toggle input { width: 20px; height: 20px; accent-color: #059669; }

.wrt-game-start-btn {
    display: block; margin: 22px auto 0; background: #059669; color: #fff; border: none; border-radius: 100px;
    padding: 14px 36px; font-size: 17px; font-weight: 700; cursor: pointer; transition: background 0.15s;
}
.wrt-game-start-btn:hover { background: #047857; }

.wrt-game-score { display: flex; justify-content: center; gap: 24px; margin-bottom: 12px; font-size: 14px; font-weight: 700; }
.wrt-game-score-correct { color: #16a34a; }
.wrt-game-score-wrong { color: #dc2626; }

.wrt-game-task-row { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 10px; }
.wrt-game-task { font-size: 16px; font-weight: 700; color: #64748b; }
.wrt-game-target { font-size: 34px; font-weight: 800; color: #059669; line-height: 1.1; background: #ecfdf5; border-radius: 12px; padding: 2px 14px; }
.wrt-game-speak-btn {
    border: 2px solid #a7f3d0; background: #ecfdf5; color: #047857; border-radius: 100px;
    width: 40px; min-height: 40px; font-size: 17px; cursor: pointer; line-height: 1;
}
.wrt-game-speak-btn:hover { background: #d1fae5; }

.wrt-game-canvas-wrap {
    position: relative; width: 100%; max-width: 360px; margin: 0 auto;
    background: #fff; border: 3px dashed #a7f3d0; border-radius: 18px; overflow: hidden;
}
.wrt-game-canvas-wrap::before,
.wrt-game-canvas-wrap::after {
    content: ""; position: absolute; left: 6%; right: 6%; height: 2px; background: #e2e8f0; pointer-events: none;
}
.wrt-game-canvas-wrap::before { top: 26%; }
.wrt-game-canvas-wrap::after { top: 74%; }
.wrt-game-canvas {
    display: block; margin: 0 auto; max-width: 100%; touch-action: none; cursor: crosshair;
    background: transparent; position: relative; z-index: 1;
}

.wrt-game-tools { display: flex; gap: 10px; justify-content: center; align-items: center; flex-wrap: wrap; margin-top: 14px; }
.wrt-game-tool-btn {
    border: 2px solid #d1d5db; background: #f9fafb; border-radius: 100px; padding: 11px 20px; cursor: pointer;
    font-size: 15px; font-weight: 700; transition: all 0.15s;
}
.wrt-game-tool-btn:hover { border-color: #9ca3af; background: #f3f4f6; }
.wrt-game-check-btn {
    border: none; background: #059669; color: #fff; border-radius: 100px; padding: 12px 28px; cursor: pointer;
    font-size: 16px; font-weight: 800; transition: background 0.15s;
}
.wrt-game-check-btn:hover { background: #047857; }
.wrt-game-check-btn:disabled { opacity: 0.45; cursor: default; }

.wrt-game-feedback { text-align: center; min-height: 104px; padding-top: 10px; }
.wrt-game-feedback-emoji { font-size: 52px; display: inline-block; animation: wrt-pop 0.4s ease; }
@keyframes wrt-pop { 0% { transform: scale(0.3); opacity: 0; } 60% { transform: scale(1.15); opacity: 1; } 100% { transform: scale(1); } }
.wrt-game-feedback-text { font-size: 15px; font-weight: 700; margin-top: 6px; }
.wrt-game-feedback-text.is-correct { color: #16a34a; }
.wrt-game-feedback-text.is-wrong { color: #dc2626; }
.wrt-game-hint { font-size: 13.5px; color: #64748b; margin-top: 5px; }

.wrt-game-self-row { display: flex; gap: 12px; justify-content: center; margin-top: 12px; flex-wrap: wrap; }
.wrt-game-self-btn {
    border: 2px solid #d1d5db; background: #fff; border-radius: 100px; padding: 12px 24px; cursor: pointer;
    font-size: 16px; font-weight: 800; transition: all 0.15s;
}
.wrt-game-self-btn.is-yes { border-color: #86efac; color: #15803d; }
.wrt-game-self-btn.is-yes:hover { background: #ecfdf5; border-color: #16a34a; }
.wrt-game-self-btn.is-no { border-color: #fed7aa; color: #c2410c; }
.wrt-game-self-btn.is-no:hover { background: #fff7ed; border-color: #ea580c; }

.wrt-game-back-btn { display: block; margin: 16px auto 0; background: none; border: none; color: #6b7280; font-size: 13px; cursor: pointer; text-decoration: underline; }

@media (max-width: 480px) {
    .wrt-game { padding: 18px; }
    .wrt-game-canvas-wrap { max-width: 100%; }
    .wrt-game-mode-btn { font-size: 14px; padding: 10px 13px; }
}
@media (max-width: 760px) {
    .wrt-game-layout { flex-direction: column; align-items: stretch; }
    .wrt-game-sidebar { width: 100%; flex-basis: auto; max-height: 220px; order: 2; }
}

.game-focus-overlay .wrt-game-layout { margin: 0 auto; }