/* =================================================================
   AL60 Scrabble Go – Plugin CSS
   Senior-friendly, mobile-first, adaptiert aus dem AL60 Theme
   ================================================================= */

/* ── Basis-Variablen (gleiche Palette wie das Theme) ──────────── */
.al60s-wrap {
    --s-primary:    #1e6db5;
    --s-primary-dk: #15508a;
    --s-green:      #2e8b57;
    --s-green-dk:   #1f6040;
    --s-orange:     #d4700a;
    --s-red:        #c0392b;
    --s-gray:       #555;
    --s-bg:         #f7fafc;
    --s-surface:    #ffffff;
    --s-border:     #d0d8e0;
    --s-text:       #1a1a1a;
    --s-muted:      #666;

    /* Spielbrett-Farben */
    --tw-color:     #c0392b;   /* Triple Word  */
    --dw-color:     #e8a0a0;   /* Double Word  */
    --tl-color:     #1a6db0;   /* Triple Letter */
    --dl-color:     #7fb3d3;   /* Double Letter */
    --center-color: #f39c12;   /* Stern-Mitte  */
    --cell-color:   #e8d5b7;   /* Normal       */
    --tile-bg:      #f5e6c3;
    --tile-border:  #a08040;

    --radius:  10px;
    --shadow:  0 2px 10px rgba(0,0,0,.12);
    --font:    'Segoe UI', Arial, sans-serif;

    font-family: var(--font);
    font-size:   18px;
    color:       var(--s-text);
    background:  var(--s-bg);
}

/* ── Screens ─────────────────────────────────────────────────── */
.al60s-screen { width: 100%; }

/* ── Logo / Modus-Auswahl ────────────────────────────────────── */
.al60s-mode-box {
    max-width: 560px;
    margin: 0 auto;
    padding: 2rem 1.25rem;
    text-align: center;
}

.al60s-logo {
    margin-bottom: 2rem;
}

.al60s-logo-icon {
    font-size: 3.5rem;
    display: block;
    margin-bottom: .5rem;
}

.al60s-logo h1 {
    font-size: 2.4rem;
    font-weight: 800;
    color: var(--s-primary);
    margin: 0 0 .25rem;
    letter-spacing: -1px;
}

.al60s-tagline {
    font-size: 1.05rem;
    color: var(--s-muted);
}

.al60s-mode-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.al60s-mode-btn {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border: 2px solid transparent;
    border-radius: var(--radius);
    font-family: var(--font);
    cursor: pointer;
    transition: transform .15s, box-shadow .15s;
    text-align: left;
}

.al60s-mode-btn:hover,
.al60s-mode-btn:focus {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    outline: none;
}

.al60s-btn-primary {
    background: var(--s-primary);
    color: #fff;
}

.al60s-btn-secondary {
    background: var(--s-green);
    color: #fff;
}

.al60s-mode-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.al60s-mode-btn strong {
    display: block;
    font-size: 1.25rem;
}

.al60s-mode-btn small {
    font-size: .9rem;
    opacity: .85;
}

/* Highscores Startscreen */
.al60s-highscores-box {
    background: var(--s-surface);
    border: 1px solid var(--s-border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    text-align: left;
}

.al60s-highscores-box h2 {
    font-size: 1.1rem;
    margin-bottom: .6rem;
    color: var(--s-primary);
}

.al60s-hs-list {
    list-style: decimal inside;
    padding: 0;
    margin: 0;
}

.al60s-hs-list li {
    display: flex;
    justify-content: space-between;
    padding: .2rem 0;
    font-size: .95rem;
    border-bottom: 1px solid var(--s-border);
}

.al60s-hs-list li:last-child { border: none; }
.al60s-hs-empty { color: var(--s-muted); list-style: none; }

.al60s-hint {
    font-size: .9rem;
    color: var(--s-muted);
    line-height: 1.5;
    margin-top: .5rem;
}

/* ── Header (Spielfeld) ──────────────────────────────────────── */
.al60s-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--s-primary);
    color: #fff;
    padding: .6rem 1rem;
    border-radius: var(--radius) var(--radius) 0 0;
    flex-wrap: wrap;
    gap: .5rem;
}

.al60s-score-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 80px;
}

.al60s-score-label {
    font-size: .85rem;
    opacity: .85;
}

.al60s-score-val {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
}

.al60s-header-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .15rem;
}

.al60s-bag-info {
    font-size: .85rem;
    opacity: .8;
    background: rgba(255,255,255,.15);
    padding: .15rem .6rem;
    border-radius: 20px;
}

.al60s-turn-info {
    font-size: 1rem;
    font-weight: 700;
}

/* ── Timer ───────────────────────────────────────────────────── */
.al60s-timer-bar {
    position: relative;
    height: 6px;
    background: #ddd;
}

.al60s-timer-fill {
    height: 100%;
    background: var(--s-green);
    transition: width 1s linear, background .5s;
    width: 100%;
}

.al60s-timer-fill.warn  { background: var(--s-orange); }
.al60s-timer-fill.danger{ background: var(--s-red); }

#al60s-timer-text {
    position: absolute;
    right: .5rem;
    top: -1.3rem;
    font-size: .8rem;
    color: var(--s-muted);
}

/* ── Spielbrett ──────────────────────────────────────────────── */
.al60s-board-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: .5rem;
    background: #c8a06a;
    border-left: 4px solid #a06020;
    border-right: 4px solid #a06020;
}

.al60s-board {
    display: grid;
    grid-template-columns: repeat(15, 1fr);
    gap: 2px;
    width: 100%;
    max-width: 660px;
    margin: 0 auto;
    user-select: none;
}

/* Board-Zelle */
.al60s-cell {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    cursor: pointer;
    font-size: .55rem;
    font-weight: 700;
    text-transform: uppercase;
    background: var(--cell-color);
    color: #5a3a00;
    transition: opacity .15s, box-shadow .15s;
    position: relative;
    min-width: 0;
    overflow: hidden;
    text-align: center;
    line-height: 1.1;
}

.al60s-cell:hover   { opacity: .85; }
.al60s-cell.al60s-highlight { box-shadow: inset 0 0 0 2px #fff, 0 0 6px rgba(255,255,255,.6); }

/* Premium squares */
.al60s-cell.tw { background: var(--tw-color); color: #fff; }
.al60s-cell.dw { background: var(--dw-color); color: #6a0000; }
.al60s-cell.tl { background: var(--tl-color); color: #fff; }
.al60s-cell.dl { background: var(--dl-color); color: #003360; }
.al60s-cell.cn { background: var(--center-color); color: #fff; }

/* Gelegter Buchstabe */
.al60s-cell.has-tile {
    background: var(--tile-bg);
    box-shadow: inset 1px 1px 0 rgba(255,255,255,.7), 2px 2px 0 var(--tile-border);
    cursor: default;
    font-size: .8rem;
}

.al60s-cell.has-tile .al60s-cell-letter {
    font-size: 1rem;
    font-weight: 900;
    color: #2a1400;
}

.al60s-cell.has-tile .al60s-cell-value {
    font-size: .5rem;
    font-weight: 700;
    color: #7a5010;
    position: absolute;
    bottom: 1px;
    right: 2px;
}

/* Gerade gelegte Kachel (diese Runde) */
.al60s-cell.placed-now {
    background: #fff8dc;
    box-shadow: inset 1px 1px 0 rgba(255,255,255,.9), 2px 2px 0 #c8a000, 0 0 0 2px var(--center-color);
}

/* Drop-Ziel-Highlight */
.al60s-cell.drop-target {
    box-shadow: inset 0 0 0 3px var(--s-green);
    opacity: 1;
}

/* ── Regal ───────────────────────────────────────────────────── */
.al60s-rack-wrap {
    background: #8B6914;
    padding: .5rem .75rem;
    display: flex;
    justify-content: center;
    border-left: 4px solid #6a4a00;
    border-right: 4px solid #6a4a00;
}

.al60s-rack {
    display: flex;
    gap: 6px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Regal-Kachel */
.al60s-tile {
    width: 52px;
    height: 56px;
    background: var(--tile-bg);
    border-radius: 5px;
    box-shadow: inset 1px 1px 0 rgba(255,255,255,.8),
                0 3px 0 var(--tile-border),
                1px 1px 4px rgba(0,0,0,.25);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    transition: transform .1s, box-shadow .1s;
    font-family: var(--font);
}

.al60s-tile:hover,
.al60s-tile:focus {
    transform: translateY(-4px);
    box-shadow: inset 1px 1px 0 rgba(255,255,255,.8),
                0 6px 0 var(--tile-border),
                1px 1px 8px rgba(0,0,0,.3);
    outline: none;
}

.al60s-tile.selected {
    background: #fffde0;
    transform: translateY(-6px);
    box-shadow: inset 1px 1px 0 rgba(255,255,255,.9),
                0 8px 0 #c8a000,
                0 0 0 3px var(--center-color),
                1px 1px 8px rgba(0,0,0,.3);
}

.al60s-tile-letter {
    font-size: 1.5rem;
    font-weight: 900;
    color: #2a1400;
    line-height: 1;
}

.al60s-tile-value {
    font-size: .6rem;
    font-weight: 700;
    color: #7a5010;
    position: absolute;
    bottom: 3px;
    right: 5px;
}

.al60s-tile.blank .al60s-tile-letter { color: #999; font-style: italic; }

/* Leer-Platzhalter im Regal */
.al60s-tile-slot {
    width: 52px;
    height: 56px;
    border: 2px dashed rgba(255,255,255,.3);
    border-radius: 5px;
}

/* ── Aktions-Buttons ─────────────────────────────────────────── */
.al60s-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    justify-content: center;
    padding: .75rem .5rem;
    background: var(--s-bg);
    border-left: 4px solid #6a4a00;
    border-right: 4px solid #6a4a00;
}

.al60s-btn {
    padding: .65rem 1.1rem;
    font-size: 1rem;
    font-family: var(--font);
    font-weight: 700;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: filter .15s, transform .1s;
    white-space: nowrap;
}

.al60s-btn:hover   { filter: brightness(1.12); }
.al60s-btn:active  { transform: scale(.97); }
.al60s-btn:focus   { outline: 3px solid var(--s-primary); outline-offset: 2px; }

.al60s-btn:disabled {
    opacity: .45;
    cursor: not-allowed;
    filter: none;
}

.al60s-btn-green   { background: var(--s-green);   color: #fff; }
.al60s-btn-blue    { background: var(--s-primary);  color: #fff; }
.al60s-btn-orange  { background: var(--s-orange);   color: #fff; }
.al60s-btn-gray    { background: var(--s-gray);     color: #fff; }
.al60s-btn-outline {
    background: transparent;
    color: var(--s-primary);
    border: 2px solid var(--s-primary);
}

/* ── Feedback-Zeile ──────────────────────────────────────────── */
.al60s-feedback {
    text-align: center;
    padding: .5rem 1rem;
    font-size: 1rem;
    min-height: 2.2rem;
    border-left: 4px solid #6a4a00;
    border-right: 4px solid #6a4a00;
    border-bottom: 4px solid #6a4a00;
    border-radius: 0 0 var(--radius) var(--radius);
    background: var(--s-surface);
    transition: color .3s;
}

.al60s-feedback.ok    { color: var(--s-green);  font-weight: 700; }
.al60s-feedback.error { color: var(--s-red);    font-weight: 700; }
.al60s-feedback.info  { color: var(--s-primary); }

/* ── Overlay / Dialog ────────────────────────────────────────── */
.al60s-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.al60s-dialog {
    background: var(--s-surface);
    border-radius: 16px;
    padding: 2rem;
    max-width: 420px;
    width: 100%;
    text-align: center;
    box-shadow: 0 12px 40px rgba(0,0,0,.35);
}

.al60s-dialog-icon {
    font-size: 3rem;
    margin-bottom: .5rem;
}

.al60s-dialog h2 {
    font-size: 1.6rem;
    margin-bottom: .5rem;
    color: var(--s-primary);
}

.al60s-dialog p {
    font-size: 1.05rem;
    color: var(--s-muted);
    margin-bottom: 1.25rem;
    line-height: 1.6;
}

.al60s-dlg-btns {
    display: flex;
    gap: .75rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Tausch-Overlay */
.al60s-exchange-tiles {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .5rem;
    margin: 1rem 0;
}

/* ── Zellentext (Bonus-Label) ────────────────────────────────── */
.al60s-cell-label {
    font-size: .5rem;
    line-height: 1.1;
    text-align: center;
    pointer-events: none;
}

/* ── Animationen ─────────────────────────────────────────────── */
@keyframes al60s-pop {
    0%   { transform: scale(.8); opacity: 0; }
    60%  { transform: scale(1.12); }
    100% { transform: scale(1);   opacity: 1; }
}

.al60s-cell.placed-now { animation: al60s-pop .2s ease-out; }

@keyframes al60s-shake {
    0%,100% { transform: translateX(0); }
    25%     { transform: translateX(-6px); }
    75%     { transform: translateX(6px); }
}

.al60s-feedback.shake { animation: al60s-shake .3s ease; }

@keyframes al60s-score-pop {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.3); color: var(--center-color); }
    100% { transform: scale(1); }
}

.al60s-score-val.pop { animation: al60s-score-pop .4s ease; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 480px) {
    .al60s-wrap { font-size: 16px; }

    .al60s-cell { font-size: .45rem; }
    .al60s-cell.has-tile .al60s-cell-letter { font-size: .85rem; }

    .al60s-tile { width: 42px; height: 46px; }
    .al60s-tile-letter { font-size: 1.2rem; }
    .al60s-tile-slot   { width: 42px; height: 46px; }

    .al60s-btn { font-size: .9rem; padding: .55rem .85rem; }

    .al60s-score-val { font-size: 1.6rem; }
    .al60s-logo h1   { font-size: 1.8rem; }
}

@media (min-width: 700px) {
    .al60s-board { max-width: 600px; }
    .al60s-cell { font-size: .65rem; }
    .al60s-cell.has-tile .al60s-cell-letter { font-size: 1.1rem; }
    .al60s-tile { width: 60px; height: 64px; }
    .al60s-tile-letter { font-size: 1.8rem; }
    .al60s-tile-slot   { width: 60px; height: 64px; }
}

/* ── Zugänglichkeit: Fokus-Ring ──────────────────────────────── */
.al60s-cell:focus,
.al60s-tile:focus,
.al60s-mode-btn:focus {
    outline: 3px solid var(--center-color);
    outline-offset: 2px;
}
