/* ============================================================
   3CX Simon Says – game.css  v4.0
   Pixel-precise button overlays based on actual image scan:
     Image: 1220 × 2456 px
     Row 1 (1,2,3):  centre y = 757px  → 30.8%
     Row 2 (4,5,6):  centre y = 1082px → 44.1%
     Row 3 (7,8,9):  centre y = 1385px → 56.4%
     Row 4 (*,0,#):  centre y = 1678px → 68.3%
     Col 1: x = 193px → 15.8%
     Col 2: x = 610px → 50.0%
     Col 3: x = 1027px → 84.2%
     Call btn centre: y = 2114px → 86.1%, Ø 233px → 19.1%
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ── Shared reset ───────────────────────────────────────────── */
#tcxss-phone-screen *,
#tcxss-phone-screen *::before,
#tcxss-phone-screen *::after,
#tcxss-hud *,
#tcxss-hud *::before,
#tcxss-hud *::after,
#tcxss-overlay *,
#tcxss-overlay *::before,
#tcxss-overlay *::after,
#tcxss-highscores *,
#tcxss-highscores *::before,
#tcxss-highscores *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ═══════════════════════════════════════════════════════════
   1.  PHONE SCREEN  [3cx_simon_says]
   ═══════════════════════════════════════════════════════════ */

#tcxss-phone-screen {
    position: relative;
    display:  block;
    max-width: 420px;
    width:    100%;
    margin:   0 auto;
    border-radius: 18px;
    overflow: hidden;
    box-shadow:
        0 0 0 1px rgba(255,255,255,.08),
        0 24px 64px rgba(0,0,0,.7);
    user-select: none;
    -webkit-user-select: none;
}

/* Original screenshot – fills container, is pure decoration */
#tcxss-phone-img {
    display: block;
    width:   100%;
    height:  auto;
    pointer-events: none;
}

/* ── Display area for dialed numbers ───────────────────────── */
#tcxss-number-display {
    position:    absolute;
    top:         10%;
    left:        10%;
    width:       80%;
    height:      10%;
    display:     flex;
    align-items: center;
    justify-content: center;
    font-family: 'Inter', sans-serif;
    font-size:   36px;
    font-weight: 300;
    color:       #ffffff;
    letter-spacing: 4px;
    white-space: nowrap;
    z-index:     5;
    pointer-events: none;
}

#tcxss-in-screen-timer-wrap {
    position:    absolute;
    top:         20%;
    left:        10%;
    width:       80%;
    height:      4px;
    background:  rgba(255,255,255,0.1);
    border-radius: 2px;
    z-index:     5;
    pointer-events: none;
    opacity:     0;
    transition:  opacity 0.3s ease;
    overflow:    hidden;
}

#tcxss-in-screen-timer {
    width:       100%;
    height:      100%;
    background:  #4cdd74;
    border-radius: 2px;
    transform-origin: left center;
    transform:   scaleX(1);
}

.tcxss-glow-pulse {
    animation: tcxss-glow 0.4s ease-out;
}

@keyframes tcxss-glow {
    0%   { box-shadow: 0 0 0px rgba(76, 221, 116, 0); }
    50%  { box-shadow: 0 0 15px 5px rgba(76, 221, 116, 0.8); }
    100% { box-shadow: 0 0 0px rgba(76, 221, 116, 0); }
}

.tcxss-digit {
    display:     inline-block;
    transition:  color 0.2s ease, transform 0.2s ease;
}

.tcxss-digit.is-correct {
    color:       #4cdd74;
    font-weight: 500;
    transform:   scale(1.1);
}

.tcxss-digit.is-wrong {
    color:       #dc3232;
    font-weight: 600;
    transform:   scale(1.1);
}

.tcxss-display-msg {
    font-size:   24px;
    font-weight: 600;
    color:       #dc3232;
    letter-spacing: 1px;
    animation:   tcxss-shake 0.4s ease-in-out;
}

@keyframes tcxss-shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-4px); }
    40%, 80% { transform: translateX(4px); }
}

.tcxss-display-success {
    font-size:   40px;
    color:       #4cdd74;
    animation:   tcxss-pop 0.3s ease-out;
}

.tcxss-display-info {
    font-size:   26px;
    font-weight: 500;
    color:       #ffffff;
    letter-spacing: 2px;
    animation:   tcxss-fade-in 0.3s ease-out;
}

.tcxss-display-countdown {
    font-size:   48px;
    font-weight: 700;
    color:       #ffffff;
    animation:   tcxss-pop 0.5s ease-out;
}

@keyframes tcxss-pop {
    0%   { transform: scale(0.5); opacity: 0; }
    70%  { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes tcxss-fade-in {
    0%   { opacity: 0; }
    100% { opacity: 1; }
}

/* ── Dialpad: full overlay container ────────────────────────
   The container stretches over the entire image.
   Each .tcxss-key is positioned individually via left/top
   pointing at the exact digit centre, with
   transform: translate(-50%, -50%) so the button is
   perfectly centred on that point.

   Column centres (pixel-measured):
     Col 1: x=299px / 1220 = 24.5%
     Col 2: x=610px / 1220 = 50.0%
     Col 3: x=914px / 1220 = 74.9%

   Row centres (empirically corrected from user screenshots):
     Row 1 (1,2,3):  34%
     Row 2 (4,5,6):  48%
     Row 3 (7,8,9):  62%
     Row 4 (*,0,#):  75%
   ─────────────────────────────────────────────────────────── */
#tcxss-dialpad {
    position: absolute;
    inset:    0;
    pointer-events: none;   /* container transparent – only keys are clickable */
}

/* ── Base style for every key ───────────────────────────────── */
.tcxss-key {
    position:     absolute;
    width:        17%;          /* diameter as % of container width */
    aspect-ratio: 1;
    border-radius: 50%;
    background:   transparent;
    border:       none;
    cursor:       pointer;
    /* translate(-50%,-50%) makes left/top the centre of the circle */
    transform:    translate(-50%, -50%);
    display:      flex;
    align-items:  center;
    justify-content: center;
    /* Always-visible ring so tap areas are visible */
    box-shadow:   0 0 0 2px rgba(255,255,255,.20);
    outline:      none;
    -webkit-tap-highlight-color: transparent;
    pointer-events: all;
    transition:
        background  .12s ease,
        box-shadow  .15s ease;
}

.tcxss-key:hover {
    background: rgba(255,255,255,.08);
    box-shadow: 0 0 0 2px rgba(255,255,255,.40);
}

.tcxss-key:active {
    transform: translate(-50%, -50%) scale(.88);
}

/* ── Simon flash states ──────────────────────────────────────── */
.tcxss-key.is-lit {
    background: rgba(255,255,255,.28);
    box-shadow:
        0 0 0 3px rgba(255,255,255,.75),
        0 0 32px 10px rgba(255,255,255,.22);
}
.tcxss-key.is-tapped {
    background: rgba(76,221,116,.32);
    box-shadow:
        0 0 0 3px rgba(76,221,116,.80),
        0 0 28px 8px rgba(76,221,116,.22);
}
.tcxss-key.is-error {
    background: rgba(220,50,50,.42);
    box-shadow:
        0 0 0 3px rgba(220,50,50,.85),
        0 0 30px 10px rgba(220,50,50,.28);
}

/* Row 1 */
.tcxss-key[data-key="1"] { left: 23.8%; top: 30.45%; }
.tcxss-key[data-key="2"] { left: 50.0%; top: 30.45%; }
.tcxss-key[data-key="3"] { left: 76.2%; top: 30.45%; }
/* Row 2 */
.tcxss-key[data-key="4"] { left: 23.8%; top: 43.75%; }
.tcxss-key[data-key="5"] { left: 50.0%; top: 43.75%; }
.tcxss-key[data-key="6"] { left: 76.2%; top: 43.75%; }
/* Row 3 */
.tcxss-key[data-key="7"] { left: 23.8%; top: 57.35%; }
.tcxss-key[data-key="8"] { left: 50.0%; top: 57.35%; }
.tcxss-key[data-key="9"] { left: 76.2%; top: 57.35%; }
/* Row 4 */
.tcxss-key[data-key="0"] { left: 50.0%; top: 70.45%; }


/* ── Call button overlay ─────────────────────────────────────
   Pixel-measured: centre x=50%, centre y=86.1%
   Diameter 233px on 1220px image = 19.1% of width
   ─────────────────────────────────────────────────────────── */
#tcxss-call-btn {
    position:     absolute;
    left:         50%;
    top:          86.1%;
    transform:    translate(-50%, -50%);
    width:        19.1%;
    aspect-ratio: 1;
    border-radius: 50%;
    border:       none;
    background:   transparent;
    cursor:       pointer;
    outline:      none;
    -webkit-tap-highlight-color: transparent;
    transition:   transform .15s ease, box-shadow .15s ease;
    z-index:      10;
}

#tcxss-call-btn:hover {
    box-shadow: 0 0 0 10px rgba(76,221,116,.2),
                0 0 28px rgba(76,221,116,.3);
    transform:  translate(-50%, -50%) scale(1.08);
}

#tcxss-call-btn:active {
    transform: translate(-50%, -50%) scale(.92);
}

#tcxss-call-btn.is-idle {
    animation: tcxss-pulse 2.2s ease-in-out infinite;
}

@keyframes tcxss-pulse {
    0%, 100% {
        box-shadow: 0 0 0 4px rgba(76,221,116,.15),
                    0 0 0 8px rgba(76,221,116,.07);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(76,221,116,.12),
                    0 0 36px rgba(76,221,116,.28);
    }
}

#tcxss-call-btn:disabled,
#tcxss-call-btn.is-disabled {
    cursor:     not-allowed;
    animation:  none;
    box-shadow: none;
}

/* ═══════════════════════════════════════════════════════════
   2.  HUD  [3cx_simon_hud]
   ═══════════════════════════════════════════════════════════ */

#tcxss-hud {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background:  #111111;
    border-radius: 14px;
    overflow:    hidden;
    box-shadow:
        0 0 0 1px rgba(255,255,255,.06),
        0 8px 32px rgba(0,0,0,.5);
    color: #ffffff;
    max-width: 420px;
    width: 100%;
    margin: 0 auto;
}

#tcxss-hud-status-row {
    display:         flex;
    align-items:     center;
    justify-content: space-between;
    padding:         16px 22px 14px;
    gap:             12px;
}

#tcxss-status {
    font-size:   14px;
    font-weight: 400;
    color:       rgba(255,255,255,.72);
    letter-spacing: .02em;
    transition:  color .3s;
    flex:        1;
    min-width:   0;
    overflow:    hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#tcxss-level-info {
    font-size:   13px;
    font-weight: 700;
    color:       #4cdd74;
    letter-spacing: .06em;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Timer bar */
#tcxss-timer-bar-wrap {
    height:     4px;
    background: rgba(255,255,255,.07);
    overflow:   hidden;
}

#tcxss-timer-bar {
    height:         100%;
    background:     #4cdd74;
    width:          100%;
    transform-origin: left;
    transition:     transform linear, background .4s;
}

#tcxss-timer-bar.is-warning { background: #f0a020; }
#tcxss-timer-bar.is-danger  { background: #e04040; }

/* ═══════════════════════════════════════════════════════════
   3.  GAME-OVER MODAL  (inside [3cx_simon_hud])
       position: fixed → always covers the full viewport
   ═══════════════════════════════════════════════════════════ */

#tcxss-overlay {
    position:   fixed;
    inset:      0;
    display:    flex;
    align-items: center;
    justify-content: center;
    background: rgba(6,6,6,.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index:    99999;
    animation:  tcxss-fade-in .3s ease forwards;
    padding:    20px;
}

#tcxss-overlay[hidden] { display: none !important; }

@keyframes tcxss-fade-in {
    from { opacity: 0; transform: scale(.97); }
    to   { opacity: 1; transform: scale(1);   }
}

#tcxss-overlay-inner {
    background:    #161616;
    border:        1px solid rgba(255,255,255,.08);
    border-radius: 20px;
    padding:       36px 32px;
    text-align:    center;
    display:       flex;
    flex-direction: column;
    align-items:   center;
    gap:           16px;
    width:         100%;
    max-width:     360px;
    box-shadow:    0 32px 80px rgba(0,0,0,.8);
    font-family:   'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

#tcxss-overlay-icon {
    width:  68px;
    height: 68px;
    border-radius: 50%;
    background: rgba(220,50,50,.1);
    border: 2px solid rgba(220,50,50,.35);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #e04040;
    flex-shrink: 0;
}

#tcxss-overlay-icon svg {
    width:     28px;
    height:    28px;
    transform: rotate(135deg);
}

#tcxss-overlay-title {
    font-size:   24px;
    font-weight: 700;
    color:       #fff;
    letter-spacing: -.3px;
}

#tcxss-overlay-msg {
    font-size:   14px;
    line-height: 1.7;
    color:       rgba(255,255,255,.65);
}

#tcxss-overlay-msg strong {
    color:       #4cdd74;
    font-weight: 600;
}

#tcxss-overlay-level {
    font-size:   15px;
    font-weight: 500;
    color:       rgba(255,255,255,.4);
}

#tcxss-score-form {
    display:     flex;
    flex-direction: column;
    align-items: center;
    gap:         10px;
    width:       100%;
}

#tcxss-score-form label {
    font-size:      12px;
    color:          rgba(255,255,255,.4);
    letter-spacing: .05em;
}

#tcxss-player-name {
    width:        100%;
    max-width:    260px;
    background:   rgba(255,255,255,.06);
    border:       1px solid rgba(255,255,255,.14);
    border-radius: 10px;
    color:        #fff;
    font-family:  inherit;
    font-size:    15px;
    padding:      11px 16px;
    text-align:   center;
    outline:      none;
    transition:   border-color .2s;
}

#tcxss-player-name:focus        { border-color: #4cdd74; }
#tcxss-player-name::placeholder { color: rgba(255,255,255,.25); }

#tcxss-save-score-btn {
    background:    #4cdd74;
    color:         #080808;
    border:        none;
    border-radius: 10px;
    font-family:   inherit;
    font-size:     14px;
    font-weight:   700;
    padding:       12px 36px;
    cursor:        pointer;
    transition:    background .2s, transform .15s;
    letter-spacing: .03em;
}

#tcxss-save-score-btn:hover  { background: #3ecf68; transform: translateY(-1px); }
#tcxss-save-score-btn:active { transform: translateY(0); }
#tcxss-save-score-btn:disabled {
    background: rgba(255,255,255,.08);
    color:      rgba(255,255,255,.3);
    cursor:     not-allowed;
    transform:  none;
}

#tcxss-restart-btn {
    background:  transparent;
    border:      1px solid rgba(255,255,255,.16);
    border-radius: 10px;
    color:       rgba(255,255,255,.5);
    font-family: inherit;
    font-size:   13px;
    padding:     10px 28px;
    cursor:      pointer;
    transition:  border-color .2s, color .2s;
}

#tcxss-restart-btn:hover {
    border-color: rgba(255,255,255,.45);
    color:        #fff;
}

/* ═══════════════════════════════════════════════════════════
   4.  HIGHSCORE TABLE  [3cx_simon_scores]
   ═══════════════════════════════════════════════════════════ */

#tcxss-highscores {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background:  #111111;
    border-radius: 14px;
    overflow:    hidden;
    box-shadow:
        0 0 0 1px rgba(255,255,255,.06),
        0 8px 32px rgba(0,0,0,.5);
    padding:     24px 20px 28px;
    color:       #fff;
    max-width:   420px;
    width:       100%;
    margin:      0 auto;
}

#tcxss-highscores h3 {
    font-size:   13px;
    font-weight: 700;
    color:       rgba(255,255,255,.4);
    text-transform: uppercase;
    letter-spacing: .14em;
    margin-bottom: 18px;
    text-align:  center;
}

#tcxss-score-table {
    width:           100%;
    border-collapse: collapse;
    font-size:       13px;
}

#tcxss-score-table thead th {
    color:          rgba(255,255,255,.28);
    font-weight:    600;
    text-transform: uppercase;
    font-size:      10px;
    letter-spacing: .12em;
    padding:        0 10px 10px;
    text-align:     left;
    border-bottom:  1px solid rgba(255,255,255,.07);
}

#tcxss-score-table thead th:first-child { width: 36px; text-align: center; }
#tcxss-score-table thead th:nth-child(3){ text-align: center; }
#tcxss-score-table thead th:last-child  { text-align: right; }

#tcxss-score-table tbody tr {
    border-bottom: 1px solid rgba(255,255,255,.04);
    transition:    background .15s;
}

#tcxss-score-table tbody tr:hover {
    background: rgba(255,255,255,.03);
}

#tcxss-score-table tbody td {
    padding: 10px 10px;
    color:   rgba(255,255,255,.72);
}

#tcxss-score-table tbody td:first-child  { text-align: center; font-size: 16px; }
#tcxss-score-table tbody td:nth-child(3) { text-align: center; font-weight: 700; color: #4cdd74; }
#tcxss-score-table tbody td:last-child   { text-align: right; color: rgba(255,255,255,.28); font-size: 11px; }

.tcxss-no-scores {
    text-align: center;
    color:      rgba(255,255,255,.25);
    font-size:  13px;
    padding:    20px 0;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 480px) {
    #tcxss-phone-screen { border-radius: 0; }
    #tcxss-hud          { border-radius: 0; }
    #tcxss-highscores   { border-radius: 0; }
}
